<?php

Raise::load('control.GoogleAnalytics');
Raise::load('core.dom.RaiseDomParser');

/**
 * TestControlGoogleAnalytics class
 * Testing unit of 'phpraise/control/GoogleAnalytics.php'
 *
 * @author Sam-Mauris Yong / hellclanner at live dot com
 * @license http://www.opensource.org/licenses/bsd-license New BSD License
 * @package Raise.UnitTest.Test
 */
class TestControlGoogleAnalytics extends RaiseTest {

    public static function testClass(){
        self::assertClassExists('GoogleAnalytics');
        self::assertClassExtends('GoogleAnalytics', 'RaiseUIControl');
        $ga = new GoogleAnalytics('sampleCode');

        $tree = RaiseDomParser::parseString($ga->output());
        self::assertObjectClass($tree->get(0), 'RaiseDomNode');
        self::assertStrictEqual($tree->get(0)->tagName(), 'script');
        self::assertStrictEqual($tree->count(), 1);
    }
    
}

